
#include <iostream>
#include "matrix.h"
#include "geomTypes.h"
#include "quaternion.h"
#include "dualQuaternion.h"

using namespace std;
typedef float                    Number;
typedef Point<2, Number>         Point2;
typedef Point<3, Number>         Point3;
typedef Vector<3, Number>        Vector3;

typedef Quaternion<Number>       Quat;
typedef DualQuaternion<Number>   DualQuat;

typedef MatrixT<Number>          Matrix;

int main () {
   
   Point2 a(3,5);
   Point3 p, q;
   Vector3 v(2,4,6);
   Vector3 u(1,3,5);
   Vector3 w = u+v;
   
   p = Point3(1,0,2);
   q = p;
   Point3 r = p + v; // point + vector opertation
   
   Number s = 5.248;
   Vector3 rr = u;
   Vector3 qq = rr*s; // vector * scalar product
   Vector3 pp = s*rr; // scalar * vector product
   
   cout<<p<<endl;
   cout<<q<<endl;
   cout<<a<<endl;
   cout<<v<<endl;
   cout<<r<<endl;
   cout<<w<<endl;
   cout<<qq<<endl;
   cout<<pp<<endl;
   cout<<"dot product: "<<u*v<<endl;
   cout<<"cross product: "<<cross_product(u,v)<<endl;
   
   /// //////////////////////
   
   Quat qu0(1,2,3,4);
   Quat qu1(qu0);
   Quat qu2 = qu0 + qu1;
   Quat qu3 = qu0 * qu1;
   Number dotq = dot(qu0, qu1);
   Quat qu4 = conjugate(qu0);
   Quat qu5 = Quat::fromAxisAngle(1,1,0,0.7);
   
   cout<<"qu0: "<<qu0<<endl;
   cout<<"qu2: "<<qu2<<endl;
   cout<<"qu3: "<<qu3<<endl;
   cout<<"dot: "<<dotq<<endl;
   cout<<"qu4: "<<qu4<<endl;
   cout<<"qu5: "<<qu5<<endl;
   
   DualQuat dq0;
   cout<<"dq0: "<<dq0<<endl;
   
   /// /////////////////////////////////////
   Matrix A(10,2), B(10,2);
   B.identity();
   cout<<A+B<<endl;
   
   return 0;
}
